//--------------------------------------------
//  Author        : Santosh Poojari
//  Created Date  : 22/02/2008
//  Email ID      : santosh.poojari@gmail.com
//--------------------------------------------


#region References
using System;
using System.Collections.Generic;
using System.Text;
using Project.Practice.MVP.Domain;
using System.Data.SqlClient;
using System.Data;
using Project.Practice.MVP.ExceptionHandling.CustomException;
#endregion

namespace Project.Practice.MVP.DataAccess
{
    public partial class DataProvider
    {
        /// <summary>
        /// Get DemandList 
        /// </summary>
        /// <returns></returns>
        public static int AddOperation(int result)
        {
            string error = "DATA_ACCESS_LAYER";
            try
            {
                if (error == "SQL_DAL_EXCEPTION")
                { 
                    throw new SQLDALException("SQL Store Procedure Not Found") ;
                }
                if (error == "DATA_ACCESS_LAYER")
                {
                    throw new DataAccesLayerException("Data Not Found Error");
                }
                if (error == "CRITICAL EXCEPTION")
                {
                    throw new CriticalException();
                }
            }
            catch(Exception ex)
            {
                ProcessDataAccessLayerException(ex);
            }
            return result;
        }       
    }
}
